﻿using UnityEngine;
using System.Collections.Generic;

public class TestingRobot : BaseRobot {

	float time;

	protected override void Start () {
		SetName("TestingRobot_"+GetRobotId());
		SetTeam("Testing");
		time = 0;
		Scan(Vector3.right, 360f, 6f);
	}
	
	protected override void Update () {
		time += deltaTime;
		if (time < 0.5f) {
			Push(Vector3.forward*1000f);
		} else
			Brake();
		
		while (receivedDamage.Count != 0) {
			KeyValuePair<int, int> damage = receivedDamage.Dequeue();
			Print("Received "+damage.Value+" damage from "+damage.Key);
		}
		
		while (raycastResults.Count != 0) {
			RaycastResult result = raycastResults.Dequeue();
			Print("Hit on "+result.hitPosition);
		}
		
		while (scanResults.Count != 0) {
			ScanResult result = scanResults.Dequeue();
			Fire (result.direction, result.distance);
		}
	}
}
